import Vue from "vue";
import VueRouter from "vue-router";
import Home from "../views/Home.vue";
import homepage from "../components/HomePage.vue";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "home",
    component: Home,
    children: [
      {
        path: "",
        name: "homepage",
        component: homepage
      },
      {
        path: "homepage",
        name: "homepage",
        component: homepage
      },
      {
        path: "aboutus",
        name: "aboutus",
        component: () => import("../components/AboutUs.vue")
      },
      {
        path: "products",
        name: "products",
        component: () => import("../components/Products.vue")
      },
      {
        path: "join",
        name: "join",
        component: () => import("../components/Join.vue")
      },
      {
        path: "news",
        name: "news",
        component: () => import("../components/News.vue")
      },
      {
        path: "newsdetail",
        name: "newsdetail",
        component: () => import("../components/NewsDetail.vue")
      },
      {
        path: "store",
        name: "store",
        component: () => import("../components/Store.vue")
      }
    ]
  }
];

const router = new VueRouter({
  routes
});

export default router;
